Mega Code Archive

Categories
1) Android
2) ASP.Net
3) ASP.Net Tutorial
4) C
5) C Tutorial
6) C#
7) C# Book
8) C# by API
9) C# Tutorial
10) C++
11) C++ Tutorial
12) Delphi
13) Flash ActionScript
14) Flex
15) Java
16) Java Book
17) Java by API
18) Java Tutorial
19) JavaScript DHTML
20) JavaScript Reference
21) JavaScript Tutorial
22) MSOfficeExcel 2007 Tutorial
23) MSOfficePowerPoint 2007 Tutorial
24) MSOfficeWord 2007 Tutorial
25) MSSQL
26) MSSQL Tutorial
27) MySQL
28) MySQL Tutorial
29) Oracle PLSQL
30) Oracle PLSQL Tutorial
31) Perl
32) Php
33) PostgreSQL
34) Python
35) Python Tutorial
36) Ruby
37) Silverlight
38) VB.Net
39) VB.Net by API
40) VB.Net Tutorial
41) Visual C++ .NET
42) VisualBasic Script
43) XML
44) XML Tutorial
 
Ruby
1) Active Record
2) Array
3) CGI
4) Class
5) Collections
6) Database
7) Date
8) Design Patterns
9) Development
10) File Directory
11) GUI
12) Hash
13) Language Basics
14) Method
15) Network
16) Number
17) Rails
18) Range
19) Reflection
20) Statement
21) String
22) Threads
23) Time
24) Tk
25) Unit Test
26) Windows Platform
27) XML
Method
1) 0 step(50, 5) { code to loop here }
2) 1 upto(5) { code to loop here }
3) 1 upto(5) { number puts number }
4) 10 downto(5) { code to loop here }
5) A block is a section of code that can be passed to a method much like passing an argument
6) A code block is an anonymous, nameless method or function
7) A Proc is an object that holds a chunk of code
8) A quicker way to create our hello Proc
9) A simple definition for a method named hello, created with the keywords def and end
10) A variable number of arguments stored in an array
11) Add a new method by add method to Class
12) Add a new method with define_method
13) After yield executes, control comes back to the next statement immediately following yield
14) Alias a old method a new name, then change the implementation of old method
15) Aliasing Methods
16) Assign method pointer to another method
17) Because its returning multiple values from a method, Ruby returns an array
18) Bind a block to a method
19) Block as the third parameter
20) Block is invoked in conjunction with a method
21) Block pointer
22) Built-In Reflection
23) Call a function for a parameter with or without parenthesis
24) Call method from parameter
25) Call String instance_method to get a method pointer
26) Calling Methods Dynamically
27) Coax a method to convert an associated block to a proc on the fly
28) Code Blocks and each method
29) Contain two yields, then call it with a block It executes the block twice
30) Convert a block into an object
31) Converting Between Degrees and Radians
32) Create a Wrapper method to alias
33) Creating and Calling a Method
34) Def and end define the welcome method
35) Default Arguments
36) Define a method to convert Cartesian (x,y) coordinates to Polar
37) Define hello so that it contains only a yield statement
38) Define methods that have arguments
39) Define your own method with defend
40) Define_method method allows you to create methods on the fly
41) Defined, And, Or, and Not
42) Execute the yield statement any number of times
43) Function with two parameters
44) Generating a Sequence of Numbers
45) Get pointer to a method in Fixnum
46) Give length a new name
47) How do you reach the code in the block from inside the method
48) If theres a block, pass in the file and close the file when it returns
49) Invoking Blocks
50) Is block ready
51) Its possible to store code blocks within variables, using the lambda method
52) Mean and standard deviation
53) Mean without float conversion
54) Metaprogramming with String Evaluations
55) Method with
56) Method with three parameters
57) Mixed parameters and varied length parameter
58) Nested block logics
59) Overloading Methods
60) Pass full arrays to methods in Ruby, and return arrays as well
61) Passing a Variable Number of Arguments
62) Passing Arguments to a Method
63) Passing Data to Methods with or without parenthesis
64) Place a space between the pipes ( ) and the variable names
65) Prefixing the array with an asterisk
66) Print all the elements in an array using the each method followed by a block
67) Proc object picks up the surrounding environment when it is created
68) Provide different number of parameters for lambda
69) Raise ArgumentError
70) Raise exception based on parameter type
71) Recursive function call
72) Redefining Backquotes
73) Remove a method for an intance
74) Remove a new added method after calling
75) Return a binding
76) Return a lambda function
77) Return a Value from a Method
78) Return the index of the first occurrence of target within array or nil
79) Return two copies of x, if x is not nil
80) Return values from function without using return statement
81) Returning a Value from a Method
82) Returning Multiples Values from a Method
83) Ruby lets you store procedures or procs, as theyre called as objects, complete with their context
84) Ruby makes it easy to handle multiple return values - no need to work with arrays explicitly at all
85) Ruby returns the last value calculated, you can omit the return keyword if you want
86) Running a Code Block Periodically
87) Set arguments along with variable arguments
88) So not only can you pass arguments to a method, you can also pass code blocks - and the method can even pass arguments to that code
89) String interpolation with method call
90) Taking Mean
91) The parentheses in the call are optional
92) The yield Statement using the block_given method from Kernel
93) Track Median
94) Track Mode
95) Undefine a method with undef
96) Undefining a Method
97) Use code blocks with Ruby iterators like each, upto, downto, and times
98) Use def to define a function
99) Use lambda to create a block
100) Use lambda to create a list of function
101) Use method from String class to map a method from String to a method pointer
102) Use Method objects with iterators
103) Use Proc new to create a new method
104) Use Proc new, proc and lamda to create methods
105) Use proc to create a function
106) Uses Method objects
107) Variable Arguments
108) Write a simple function that returns members of the Fibonacci series up to a certain value
109) Writing a Method that Accepts a Block
110) Yield method automatically detects any passed code block and passes control to it
111) Yield with proc parameter
112) You can a function with or without parenthesis
113) You can call another function based on the return from this funtion call
114) You can pass data to code clocks used with methods simply by passing that data to the yield statement